package com.csylh.controller;

import com.csylh.VO.ResponseVO;
import com.csylh.entity.WasteCategory;
import com.csylh.service.CategoryService;
import com.csylh.util.ResponseVOUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by 留歌
 * Date: 2018/3/12 22:51
 * Description:
 */
@RestController
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;
    /**
     * 返回所有类目信息
     * @return
     */
    @GetMapping("/list")
    public ResponseVO getAllCategory(){
        List<WasteCategory> wasteCategoryList = categoryService.getAllCategory();
        return ResponseVOUtil.success(wasteCategoryList);
    }
}
